//
//  API.swift
//  ZYChat
//
//  Created by admin on 2019/12/26.
//  Copyright © 2019 admin. All rights reserved.
//


struct API {
    
    #if DEBUG
    static let BASE_URL = "https://api.zilot.net"
    #else
    static let BASE_URL = "https://dev-api.zilot.net"
    #endif
    
    //登陆
    static let LOGIN: String = "/biz/api/customer/login"
    //获取用户信息
    static let USER_INFO: String = "/biz/api/customer/token"
}

extension String{
//    func BaseUrl() -> String {
//        #if DEBUG
//        let url: String = API.devUrl + self
//        return url;
//        #else
//        let url: String = API.releaseUrl + self
//        return url;
//        #endif
//    }
    var BaseApi :String {
        
        var api = String.init()
        api.append(contentsOf: API.BASE_URL)
        api.append(contentsOf: self)
        return api
    }
    
    var BaseV2Api :String {
        var api = String.init()
        api.append(contentsOf: API.BASE_URL)
        api.append(contentsOf: "/v2")
        api.append(contentsOf: self)
        return api
    }
}

